import { createRouter, createWebHistory } from 'vue-router'
import Register from '@/views/zhuce/index.vue';


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/views/layout/index.vue'),
      redirect: '/login',
      children: [
        {
          path: '/order',
          component: () => import('@/views/dingdanguanli/index.vue'),
          meta: { title: '订单管理', icon: 'home-订单管理' }
        },
        {
          path: '/goods',
          component: () => import('@/views/shangpinguanli/index.vue'),
          meta: { title: '商品列表', icon: 'home-商品管理' }
        },
        {
          path: '/clientele',
          component: () => import('@/views/kehuguanli/index.vue'),
          meta: { title: '客户管理', icon: 'home-客户管理' }
        },
        {
          path: '/permission',
          component: () => import('@/views/quanxianguanli/index.vue'),
          meta: { title: '权限管理', icon: 'home-权限管理' }
        },
        {
          path: '/explore',
          component: () => import('@/views/haowutansuo/index.vue'),
          meta: { title: '好物探索', icon: 'home-好物探索' }
        },
        {
          path: '/kanban',
          component: () => import('@/views/shujukanban/index.vue'),
          meta: { title: '数据看板', icon: 'home-数据看板' }
        },

      ]
    },
    {
      path: '/login',
      component: () => import('@/views/denglu/index.vue')
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
  ],
})

export default router
